clear; clc; close all

type = 'EXPONENTIAL';
% type = 'WEIBULL';
% type = 'LOGLOGISTIC';
% type = 'LOGNORMAL';
colors = {'r','b','g','k','m','c'};
xbeta = [-10,0,1,2,3];
t = 0:0.1:50;

switch(type)
    case 'EXPONENTIAL'
        for i = 1:length(xbeta)
            lambda = exp(xbeta(i));
            S = exp(-t/lambda);
            figure(1);
            title('EXPONENTIAL');
            hold on;
            plot(t,S,colors{i})
        end
    case 'WEIBULL'
        for i = 1:length(xbeta)
            alpha = 2;
            lambda = exp(xbeta(i));
            S = exp(-(t.^alpha)/lambda);
            figure(2);
            title('WEIBULL');
            hold on;
            plot(t,S,colors{i})
        end
    case 'LOGLOGISTIC'
        for i = 1:length(xbeta)
            alpha = 1;
            lambda = exp(xbeta(i));
            S = 1./(1+(t.^alpha)/lambda);
            figure(3);
            title('LOGLOGISTIC');
            hold on;
            plot(t,S,colors{i})
        end
    case 'LOGNORMAL'
        for i = 1:length(xbeta)
            sigma = 2;
            mu = xbeta(i);
            S = 1 - normcdf(log(t),mu,sigma);
            figure(4);
            title('LOGNORMAL');
            hold on;
            plot(t,S,colors{i})
        end
end
xlabel('t'); ylabel('S(t)'); grid on
legend('xbeta=-10','xbeta=0','xbeta=1','xbeta=2','xbeta=3')